<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$课堂练习$</title>
</head>
<body>

<script>
    // var x = 10;
    // var y = 20;
    // var result = x > y ? x : y;
    // console.log(result);
    var age = parseInt(prompt("请输入年龄"));
    var result = age >= 18 ? "成年了" : "未成年";
    window.alert(result);

</script>
</body>
</html>